﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WinFromDevelopFramework
{
    public partial class App
    {
        public static readonly App Current = new App();
        #region 界面区域属性
        private Form _mainWindow;
        public Form MainWindow
        {
            get { return _mainWindow; }
            set { _mainWindow = value; }
        }
        #endregion
        #region OEAMessageBox
        /// <summary>
        /// 弹出框相关的 API
        /// </summary>
        public static readonly OEAMessageBox MessageBox = new OEAMessageBox();
        /// <summary>
        /// 使用用WPF扩展的MessageBox
        /// </summary>
        public class OEAMessageBox
        {
            public DialogResult Show(string messageText)
            {
                return Show(messageText, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            public DialogResult Show(string messageText, MessageBoxButtons button)
            {
                return Show(messageText, "提示", button, MessageBoxIcon.Information);
            }

            public DialogResult Show(string messageText, MessageBoxIcon icon)
            {
                return Show(messageText, "提示", MessageBoxButtons.OK, icon);
            }

            public DialogResult Show(string messageText, MessageBoxButtons button, MessageBoxIcon icon)
            {
                return Show(messageText, "提示", button, icon);
            }

            public DialogResult Show(string messageText, string caption)
            {
                return Show(messageText, caption, MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            public DialogResult Show(string messageText, string caption, MessageBoxButtons button)
            {
                return Show(messageText, caption, button, MessageBoxIcon.Warning);
            }

            public DialogResult Show(string messageText, string caption, MessageBoxButtons button, MessageBoxIcon icon)
            {
                return System.Windows.Forms.MessageBox.Show(messageText, caption, button, icon);
            }
        }

        #endregion

    }
}
